home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscProgressPalette / MiscProgressViewInspector.m < prev    next >
Text File  |  1995-04-12  |  2KB  |  73 lines

  1. //
  2. //    MiscProgressViewInspector.m -- a simple view class for displaying progress
  3. //        Written originally by Don Yacktman Copyright (c) 1993 by James Heiser.
  4. //                This file is maintained by James Heiser, jheiser@adobe.com.
  5. //                Version 1.0.  All rights reserved.
  6. //
  7. //        This notice may not be removed from this source code.
  8. //
  9. //    This object is included in the MiscKit by permission from the author
  10. //    and its use is governed by the MiscKit license, found in the file
  11. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  12. //    for a list of all applicable permissions and restrictions.
  13. //    
  14.  
  15.  
  16. #import "MiscProgressViewInspector.h"
  17. #define MISC_TOP_LEVEL
  18. #import "MiscProgressView.subproj/MiscProgressView.h"
  19.  
  20. @implementation MiscProgressViewInspector
  21.  
  22. - init
  23. {
  24.     char buf[MAXPATHLEN + 1];
  25.     id bundle;
  26.     
  27.     [super init];
  28.     
  29.     bundle = [NXBundle bundleForClass:[MiscProgressView class]];
  30.     [bundle getPath:buf 
  31.             forResource:"MiscProgressViewInspector" 
  32.             ofType:"nib"];
  33.     [NXApp loadNibFile:buf 
  34.            owner:self 
  35.            withNames:NO 
  36.            fromZone:[self zone]];
  37.     return self;
  38. }
  39.  
  40. - ok:sender
  41. {
  42.     if (sender == stepSlider) {
  43.         [object setStepSize:[stepSlider intValue]];
  44.         [stepText setIntValue:[stepSlider intValue]];
  45.     } 
  46.     else if (sender == stepText) {
  47.         [object setStepSize:[stepText intValue]];
  48.         [stepSlider setIntValue:[stepText intValue]];
  49.     }
  50.     [object setBackgroundColor:[backgroundColorWell color]];
  51.     [object setForegroundColor:[foregroundColorWell color]];
  52.     [object setBorderColor:[borderColorWell color]];
  53.     return [super ok:sender];
  54. }
  55.  
  56. - revert:sender
  57. {
  58.     int step = [object stepSize];
  59.     [stepSlider setIntValue:step];
  60.     [stepText setIntValue:step];
  61.     [backgroundColorWell setColor:[object backgroundColor]];
  62.     [foregroundColorWell setColor:[object foregroundColor]];
  63.     [borderColorWell setColor:[object borderColor]];
  64.     return [super revert:sender];
  65. }
  66.  
  67. - (BOOL)wantsButtons
  68. {
  69.     return NO;
  70. }
  71.  
  72. @end
  73.